<template>
	<view style="display: flex;align-items: center;justify-content: center;">
		<a-input-group compact>
			<a-select default-value="" @change="onChange" v-model="currentValue">
				<a-select-option value=''>请选择</a-select-option>
				<a-select-option value="0">
					欠费
				</a-select-option>
				<a-select-option value="1">
					正常
				</a-select-option>
				<a-select-option value="2">
					禁用
				</a-select-option>
			</a-select>
		</a-input-group>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				currentValue: '',
				statusText: [{
						value: 0,
						text: "欠费"
					},
					{
						value: 1,
						text: "正常"
					}, {
						value: 2,
						text: "终止"
					}
				]
			}
		},
		methods: {
			onChange(e) {
				console.log('onchange', e)
				console.log('onchange currentValue', this.currentValue)
				this.updateFilter()
			},
			onFloatingFilterChanged(a){
				this.currentValue = a 
				this.updateFilter()
			},
			updateFilter() {
				this.params.filterChangedCallback();
			},

			doesFilterPass(params) {
				console.log(params.data.status == this.currentValue)
				return params.data.status == this.currentValue
			},
			isFilterActive() {
				if(this.currentValue!=''){
					return true 
				}
			},
			// this example isn't using getModel() and setModel(),
			// so safe to just leave these empty. don't do this in your code!!!
			getModel() {},

			setModel() {},
		}
	}
</script>
